<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	response.setContentType("text/html;charset=UTF-8");
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String path = request.getContextPath();
%>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1.0, user-scalable=no" />
		<title>快闪交友趴</title>
		<link rel="stylesheet" href="<%=path%>/css/dating/public.css" />
		<link rel="stylesheet" href="<%=path%>/css/dating/bootstrap.min.css" />
		<link rel="stylesheet" href="<%=path%>/css/dating/font-awesome.css" />
		<%-- <link rel="stylesheet" href="<%=path%>/css/dating/need/layer.css" /> --%>
		<link rel="stylesheet" href="<%=path%>/css/validationEngine.jquery.css" />
		
		<script type="text/javascript" src="<%=path%>/js/dating/jquery-2.2.3.min.js" ></script>
		<script>
		var _hmt = _hmt || [];
		(function() {
		  var hm = document.createElement("script");
		  hm.src = "//hm.baidu.com/hm.js?00c669a13632b889c7e68663fadb613e";
		  var s = document.getElementsByTagName("script")[0]; 
		  s.parentNode.insertBefore(hm, s);
		})();

		</script>
	</head>
	<body style="background: #ffffff;">
	<span id="musicControl">
	        <a id="mc_play" class="on" onclick="play_music();">
	            <audio id="musicfx" loop="loop" >
	                <source src="../img/dating/song.mp3" type="audio/mpeg">
	            </audio>
	        </a>
	    </span>	
		<div style="width:100%;height:100%;position: absolute;background: #00aeef;z-index: 99999;" class="uu">
			<div style="width:100%;height:100%;position: relative;">
				<div class="ld">
					<div class="ld-bd">
						<img src="<%=path%>/img/dating/dog.png" alt=""  class="zx"/>
						<div class="yf">
							<img src="<%=path%>/img/dating/yf1.png" alt=""/>
							<img src="<%=path%>/img/dating/yf2.png" alt=""/>
							<img src="<%=path%>/img/dating/yf3.png" alt=""/>
							<img src="<%=path%>/img/dating/yf4.png" alt=""/>
						</div>
					</div>			
				</div>
			</div>
			
		</div>
		<div class="first-page">
			<div class="mp">
				<div class="mp-bd">
					<img src="<%=path%>/img/dating/map.jpg" alt="" />				
				</div>			
			</div>
			<div class="mp">
			    <div class="mp-car">
					<img src="<%=path%>/img/dating/scar.png" alt="" />
				</div>
			</div>
			<div class="mp-tt"  style="z-index: 70;">
				<div class="mp-pic">
					<img src="<%=path%>/img/dating/p4.png" alt="" />
					<img src="<%=path%>/img/dating/p2.png" alt="" />
					<img src="<%=path%>/img/dating/p1.png" alt="" />
					<img src="<%=path%>/img/dating/lcx.png" alt="" />
			    </div>
			</div>
			<div class="ld" style="z-index:80;top:17%;margin-top: 0;">
				<div class="ld-bd fly">
					<img src="<%=path%>/img/dating/dog.png" alt=""  class="zx"/>
					<div class="yf">
						<img src="<%=path%>/img/dating/yf1.png" alt=""/>
						<img src="<%=path%>/img/dating/yf2.png" alt=""/>
						<img src="<%=path%>/img/dating/yf3.png" alt=""/>
						<img src="<%=path%>/img/dating/yf4.png" alt=""/>
					</div>
				</div>			
			</div>
			<div class="rock">
				<div class="rock-bd">
					<img src="<%=path%>/img/dating/p3.png" alt="" />
				</div>
			</div>
		</div>
		
		<div class="bl">
			<div class="bl-bd"><img src="<%=path%>/img/dating/ball.png" alt="" /></div>
		</div>
		<div class="mt">
			<div class="mt-car">
				<img src="<%=path%>/img/dating/car1.png" alt="" class="front-car"/>
				<img src="<%=path%>/img/dating/car2.png" alt="" class="back-car"/>
			</div>			
			<div class="mt-pqj">
				<img src="<%=path%>/img/dating/ptj.png" alt=""/>
			</div>
			<div class="mt-jt">
				<img src="<%=path%>/img/dating/jt.png" alt="" />
			</div>
			<div class="mt-cloud">
				<img src="<%=path%>/img/dating/cloud.png" alt=""/>
			</div>
			
		</div>
		<div class="mt-ft">
			<div class="mt-ft-bd"><img src="<%=path%>/img/dating/ft.png" alt=""/></div>
		</div>
		<div class="biao bdxs">			
			<div class="biao-bd">
				<div class="pic">
					<img src="<%=path%>/img/dating/bgb1.png" alt="" />
				</div>
				<div class="ppbd">									
					<!-- <p>car2go 11.11</p>
					<p>"快闪交友派趴"</p>
					<p>11月11日-13日</p>
					<p>北城天街广场</p>
					<p>有型有fun的TA，脑洞大开的玩法…</p>
					<p>狂欢就绪，只等你来</p> -->
					 <form id="datingForm"   method="post">
					<input name="spread"  type="hidden" value="${spread}"/>
					<div class="bd" style="padding-top:45%">
						<span style="padding-right: 5%;padding-left:3%"><img src="<%=path%>/img/dating/ti1.png" alt="" /></span>
						<input id="name" name="name" type="text" class="validate[required,maxSize[4]]" showOneMessage="请填4个字以内" data-errormessage="请填4个字以内" data-prompt-position="topLeft" />
					</div>
					<div class="bd">
						<span style="padding-right: 5%;padding-left:3%"><img src="<%=path%>/img/dating/ti2.png" alt="" /></span>
						<input name="phone" type="text" class="validate[required,minSize[11],maxSize[11],custom[phone]]" showOneMessage="无效的手机号" data-errormessage="无效的手机号" data-prompt-position="topLeft" />
					</div>
					
					<div class="bd" style="margin-bottom: 0;">					
						<span style="padding-right: 5%;padding-left:3%"><img src="<%=path%>/img/dating/ti3.png" alt="" /></span>
						<span class="pay_list_c1">
						    <input type="radio"  name="gender" value="M" class="radioclass validate[required] radio" data-prompt-position="topLeft" />					   
						</span>
						 <span style='width:auto' class='p-r'><img src="<%=path%>/img/dating/ti8.png" alt="" style='width:90%'/></span>
						<span class="pay_list_c1">
						    <input type="radio"  name="gender" value="W" class="radioclass validate[required] radio" data-prompt-position="topLeft"/>					   
						</span>					
						 <span style='width:auto'><img src="<%=path%>/img/dating/ti9.png" alt="" style='width:90%'/></span>
					</div>
					
					
					<div class="bd" >					
						<span style="width:55%;padding-left:3%"><img src="<%=path%>/img/dating/ti4.png" alt="" /></span>
						<span class="pay_list_c1">
						    <input type="radio"  name="member" value="Y" class="radioclass validate[required] radio" data-prompt-position="topLeft"/>					   
						</span>
						 <span style="width:auto;"><img src="<%=path%>/img/dating/ti10.png" alt="" style='width:90%'/></span>
						<span class="pay_list_c1">
						    <input type="radio"  name="member" value="N" class="radioclass validate[required] radio" data-prompt-position="topLeft"/>					   
						</span>					
						 <span style="width:auto;"><img  src="<%=path%>/img/dating/ti11.png" alt="" style='width:90%'/></span>
					</div>
					
					<div class="bd">
						<span class="seb" style="padding-right: 5%;padding-left:3%"><img src="<%=path%>/img/dating/ti5.png" alt="" /></span>
						<span class="fa fa-angle-down s-jt"></span>
						<select id="signTime" name="signTime" style="font-size:12px;">
							<option id="shiyi" value="11.11">11/11 18:00开始</option>
							<option value="11.12">11/12 15:30开始</option>
							<option value="11.13">11/13 15:30开始</option>
						</select>
					</div>
					
					<div class="bd">
						<a href="#" class="a-bd qx"><img src="<%=path%>/img/dating/ti6.png" alt="" style='width:100%'/></a>
						<a onclick="javascript:jQuery('#datingForm').submit();" class="a-bd tj"><img src="<%=path%>/img/dating/ti7.png" alt="" style='width:100%'/></a>
					</div>
					<div class="jsq" style="font-size: 1.1rem; text-align: right" >
						 最终解释权归即行car2go所有
					</div>
					</form> 
				</div>
			</div>
		</div>
		
			<div class="biao wc">			
				<div class="biao-bd">
					<div class="pic">
						<img src="<%=path%>/img/dating/bgb2.png" alt="" />
					</div>
					<div class="ppwc" style='padding-top:110%'>
						<div class="bd">
							<a href="#" class="a-bd all-s"><img src="<%=path%>/img/dating/ti13.png" alt="" /></a>
						</div>
						<!-- <div class="jsq">
							 最终解释权归即行car2go所有
						</div> -->
					</div>
					
				</div>
			</div>
			<div class="share">
				<img src="<%=path%>/img/dating/jt2.png" alt="" />
				<span>点击分享</span>
			</div>
		<script type="text/javascript" src="<%=path%>/js/dating/public.js" ></script>
		<script type="text/javascript"	src="<%=path%>/js/dating/layer.js"></script>
		<script type="text/javascript"	src="<%=path%>/js/jquery.validationEngine.js"></script>
		<script type="text/javascript"	src="<%=path%>/js/jquery.validationEngine-zh_CN.js"></script>
			<script type="text/javascript">

function play_music(){
        if ($('#mc_play').hasClass('on')){
            $('#mc_play audio').get(0).pause();
            $('#mc_play').attr('class','stop');
        }else{
            $('#mc_play audio').get(0).play();
            $('#mc_play').attr('class','on');
        }
        $('#music_play_filter').hide();
        event.stopPropagation(); //阻止冒泡 
    }
    function just_play(id){
        $('#mc_play audio').get(0).play();
        $('#mc_play').attr('class','on');
        if (typeof(id)!='undefined'){
            $('#music_play_filter').hide();
        }
        event.stopPropagation(); //阻止冒泡 
    } 
    function is_weixn(){
        return false;
        var ua = navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i)=="micromessenger") {
            return true;
        } else {
            return false;
        }
    }
    // var play_filter=document.getElementById('music_play_filter');
    // play_filter.addEventListener('click', function(){
    //     just_play(1);
    // });
    // play_filter.addEventListener('touchstart', function(){
    //     just_play(1);
    // });
    // play_filter.addEventListener('touchend', function(){
    //     just_play(1);
    // });
    // play_filter.addEventListener('touchmove', function(){
    //     just_play(1);
    // });
    // play_filter.addEventListener('mousedown', function(){
    //     just_play(1);
    // });
    // play_filter.addEventListener('mouseup', function(){
    //     just_play(1);
    // });
    // play_filter.addEventListener('mousemove',function(){
    //     just_play(1);
    // });
    window.onload=function(){
        if (!is_weixn()){
            just_play();
        }
    } 
			document.onreadystatechange = subSomething;//当页面加载状态改变的时候执行这个方法. 
			function subSomething() 
			{ 
			if(document.readyState == "complete") //当页面加载状态 
				 begin();
			}
		</script>
		
		<script type="text/javascript">
			document.onreadystatechange = subSomething;//当页面加载状态改变的时候执行这个方法. 
			function subSomething() 
			{ 
			if(document.readyState == "complete") //当页面加载状态 
				 begin();
			}
		</script>
		<script type="text/javascript">
		var enough11 = "${nohave11}";
		
		jQuery(document).ready(function(){
			/* $("#shiyi").click(function(){
				if(enough11 != null | enough11 != ""){
					
				}
			}); */
			$("body").click(function(){
				jQuery('#datingForm').validationEngine('hide');
			});
			 jQuery('#datingForm').validationEngine('attach', {
				 maxErrorsPerField: 1,
				    onValidationComplete: function(form, status){
				     
				      if(status){
				    	  if(enough11 == "no"){
				    		//信息框
				    		if($("#signTime").val() == "11.11"){
				    			layer.open({
								    content: '当天活动报名人数已满，请另选他日'
								    ,btn: '我知道了'
								  });
				    			return false;
				    		}
				    		sub(); 
				    	  }else{
				    		  sub(); 
				    	  }
				    	  
				      }
				    }
				  });
		});

		/* function is_weixn(){
			var ua = navigator.userAgent.toLowerCase();
			if(ua.match(/MicroMessenger/i)=="micromessenger") {
			url= true;
			} else {
			return false;
			}} */

		/* function validate(){
			return jQuery("#datingForm").validationEngine({
				 maxErrorsPerField: 1,
					onSuccess: sub
				  });
		}  */
		function wcshow(){
	    	$('.wc').slideDown(2000);			    	
	    }
			function sub(){
				
				$.ajax({
	                cache: true,
	                type: "POST",
	                url:"<%=path%>/dating/signIn.html",
	                data:$('#datingForm').serialize(),// 你的formid
	                async: false,
	                error: function(request) {
	                    alert("Connection error");
	                },
	                success: function(data) {
	                	$('.biao').slideUp(2000);
				    	setTimeout(wcshow,2000);
	                }
	            });
			}
			
		</script>
		<script src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
		<script type="text/javascript">
		var spread = "${spread}";
		//微信jssdk config
		wx.config({
			debug : false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
			appId : '${appid}', // 必填，公众号的唯一标识
			timestamp : '${timestamp}', // 必填，生成签名的时间戳
			nonceStr : '${noncestr}', // 必填，生成签名的随机串
			signature : '${signature}',// 必填，签名，见附录1
			jsApiList : [ 'checkJsApi', //判断当前客户端版本是否支持指定JS接口
			'onMenuShareTimeline', //分享给好友
			'onMenuShareAppMessage', //分享到朋友圈
			'onMenuShareQZone', //分享到Q空间
			'onMenuShareWeibo',//分享到微博
			'onMenuShareQQ'//分享到qq
			]
		// 必填，需要使用的JS接口列表，所有JS接口列表见附录2
		});
		wx.ready(function() { //ready函数用于调用API，如果你的网页在加载后就需要自定义分享和回调功能，需要在此调用分享函数。//如果是微信游戏结束后，需要点击按钮触发得到分值后分享，这里就不需要调用API了，可以在按钮上绑定事件直接调用。因此，微信游戏由于大多需要用户先触发获取分值，此处请不要填写如下所示的分享API
					wx.onMenuShareTimeline({ //分享到朋友圈的API  
								title : '人生苦短，不如跟我一趴定情？', // 分享标题
								link : 'http://run.xuanzhen-tech.com/car2go_wx/dating/registered.html?spread=wechatshare', // 分享链接
								imgUrl : 'http://run.xuanzhen-tech.com/car2go_wx/img/dating/share1.jpg', // 分享图标
								success : function() {
									// 用户确认分享后执行的回调函数
									$.ajax({
						                cache: true,
						                type: "POST",
						                url:"<%=path%>/dating/wechatShare",
						                data:$('#datingForm').serialize(),// 你的formid
						                async: false,
						                error: function(request) {
						                    alert("Connection error");
						                },
						                success: function(data) {
						                	
						                }
						            });
								},
								cancel : function() {
									// 用户取消分享后执行的回调函数
								}
							});
					wx.onMenuShareAppMessage({//分享到朋友 
								title : '人生苦短，不如跟我一趴定情？', // 分享标题
								desc : '我这儿有很多关系，想与你发生。', // 分享描述
								link : 'http://run.xuanzhen-tech.com/car2go_wx/dating/registered.html?spread=wechatshare', // 分享链接
								imgUrl : 'http://run.xuanzhen-tech.com/car2go_wx/img/dating/share1.jpg', // 分享图标
								type : 'link', // 分享类型,music、video或link，不填默认为link
								dataUrl : '', // 如果type是music或video，则要提供数据链接，默认为空
								success : function() {
									// 用户确认分享后执行的回调函数
									$.ajax({
						                cache: true,
						                type: "POST",
						                url:"<%=path%>/dating/wechatShare",
						                data:$('#datingForm').serialize(),// 你的formid
						                async: false,
						                error: function(request) {
						                    alert("Connection error");
						                },
						                success: function(data) {
						                	
						                }
						            });
								},
								cancel : function() {
									// 用户取消分享后执行的回调函数
								}
							});
					wx.onMenuShareQZone({//分享到qq空间
					    title: '人生苦短，不如跟我一趴定情？', // 分享标题
					    desc: '我这儿有很多关系，想与你发生。', // 分享描述
					    link: 'http://run.xuanzhen-tech.com/car2go_wx/dating/registered.html?spread=wechatshare', // 分享链接
					    imgUrl: 'http://run.xuanzhen-tech.com/car2go_wx/img/dating/share1.jpg', // 分享图标
					    success: function () { 
					       // 用户确认分享后执行的回调函数
					    	$.ajax({
				                cache: true,
				                type: "POST",
				                url:"<%=path%>/dating/wechatShare",
				                data:$('#datingForm').serialize(),// 你的formid
				                async: false,
				                error: function(request) {
				                    alert("Connection error");
				                },
				                success: function(data) {
				                	
				                }
				            });
					    },
					    cancel: function () { 
					        // 用户取消分享后执行的回调函数
					    }
					});
					wx.onMenuShareWeibo({
					    title: '人生苦短，不如跟我一趴定情？', // 分享标题
					    desc: '我这儿有很多关系，想与你发生。', // 分享描述
					    link: 'http://run.xuanzhen-tech.com/car2go_wx/dating/registered.html?spread=wechatshare', // 分享链接
					    imgUrl: 'http://run.xuanzhen-tech.com/car2go_wx/img/dating/share1.jpg', // 分享图标
					    success: function () { 
					       // 用户确认分享后执行的回调函数
					    	$.ajax({
				                cache: true,
				                type: "POST",
				                url:"<%=path%>/dating/wechatShare",
				                data:$('#datingForm').serialize(),// 你的formid
				                async: false,
				                error: function(request) {
				                    alert("Connection error");
				                },
				                success: function(data) {
				                	
				                }
				            });
					    },
					    cancel: function () { 
					        // 用户取消分享后执行的回调函数
					    }
					});
					wx.onMenuShareQQ({//分享到qq
					    title: '人生苦短，不如跟我一趴定情？', // 分享标题
					    desc: '我这儿有很多关系，想与你发生。', // 分享描述
					    link: 'http://run.xuanzhen-tech.com/car2go_wx/dating/registered.html?spread=wechatshare', // 分享链接
					    imgUrl: 'http://run.xuanzhen-tech.com/car2go_wx/img/dating/share1.jpg', // 分享图标
					    success: function () { 
					       // 用户确认分享后执行的回调函数
					    	$.ajax({
				                cache: true,
				                type: "POST",
				                url:"<%=path%>/dating/wechatShare",
				                data:$('#datingForm').serialize(),// 你的formid
				                async: false,
				                error: function(request) {
				                    alert("Connection error");
				                },
				                success: function(data) {
				                	
				                }
				            });
					    },
					    cancel: function () { 
					       // 用户取消分享后执行的回调函数
					    }
					});
					
					
				});
		</script>
	</body>
</html>